﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.IO;



namespace PaathshalaHelper
{
    public class Constants
    {
    }

    public static class ImageBase
    {
        private static SortedList<ImagesIndex, BitmapImage> ImageData = new SortedList<ImagesIndex, BitmapImage>();
    
        static ImageBase()
        {          
            string strPath = "../../Images/";

            ImageData.Add(ImagesIndex.AboutUs, CreateImage(strPath + "16-member.png"));
            ImageData.Add(ImagesIndex.Admission, null);
            ImageData.Add(ImagesIndex.BatchFee, null);
            ImageData.Add(ImagesIndex.Calculater, null);
            ImageData.Add(ImagesIndex.Calender, null);

            //ImageData.Add(ImagesIndex.DeskSlip, null);
            //ImageData.Add(ImagesIndex.Employee, null);
            //ImageData.Add(ImagesIndex.Exam, null);
            //ImageData.Add(ImagesIndex.Exit, null);
            //ImageData.Add(ImagesIndex.Fee, null);

            //ImageData.Add(ImagesIndex.AboutUs, null);
            //ImageData.Add(ImagesIndex.Admission, null);
            //ImageData.Add(ImagesIndex.BatchFee, null);
            //ImageData.Add(ImagesIndex.Calculater, null);
            //ImageData.Add(ImagesIndex.Calender, null);

            //ImageData.Add(ImagesIndex.AboutUs, null);
            //ImageData.Add(ImagesIndex.Admission, null);
            //ImageData.Add(ImagesIndex.BatchFee, null);
            //ImageData.Add(ImagesIndex.Calculater, null);
            //ImageData.Add(ImagesIndex.Calender, null);

            //ImageData.Add(ImagesIndex.AboutUs, null);
            //ImageData.Add(ImagesIndex.Admission, null);
            //ImageData.Add(ImagesIndex.BatchFee, null);
            //  ImageData.Add(ImagesIndex.Calculater, null);
            //  ImageData.Add(ImagesIndex.Calender, null);


        }

        public static BitmapImage GetImage(ImagesIndex index)
        {
            return ImageData[index] as BitmapImage;
        }

        private static BitmapImage CreateImage(string path)
        {
            
                BitmapImage myBitmapImage = new BitmapImage();
                try
                {
                    myBitmapImage.BeginInit();
                    if (File.Exists(path))
                    {                  
                        myBitmapImage.UriSource = new Uri(path, UriKind.Relative);
                    }

                  
                    myBitmapImage.EndInit();
                }
                catch (Exception ex)
                {                   
                    
                }
                return myBitmapImage;
            
        }
    }

    //public Image()



    public enum ImagesIndex
    {
        AboutUs = 1,
        Admission = 2,
        BatchFee = 3,
        Calculater = 4,
        Calender = 5,
        DeskSlip = 6,
        Employee = 7,
        Exam = 8,
        Exit = 9,
        Fee = 10,
        Finance = 11,
        Lock = 12,
        Logout = 13,
        MasterData = 14,
        Registation = 15,
        Report = 16,
        Result = 17,
        Setting = 18,
        Student = 19,
        TechnicalSupport = 20,
        Topic = 21,
        Paathshala = 22,
        Search = 23,
    }

}
